/*******************************************************************************
 * The MOSES project, model based software engineering of networked embedded systems.
 * 
 * Copyright (C) 2010-2013, University of Applied Sciences Wildau,
 * Telematics Research Group, http://www.tm.th-wildau.de/research-group
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see <http://www.gnu.org/licenses>.
 * 
 * Contributors:
 *     University of Applied Sciences Wildau - initial API and implementation
 * 
 * If you are interested in a commercial license please contact us via 
 * e-mail: ralf.vandenhouten@th-wildau.de.
 ******************************************************************************/
package de.thwildau.tm.moses.common.builder;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.xtext.builder.IXtextBuilderParticipant.IBuildContext;

/**
 * An Interface to call external SyntaxChecker's. Implementations and references to this interface should be
 * typically done with OSGi services.
 * 
 * @author Thomas Kistel
 * @version $Revision$
 */
public interface ISyntaxCheckerService {

    /**
     * Executes an external Syntax-Check of the given <code>source</code> file. All results (cancellation,
     * errors or OK-Status) are reported via the {@link IStatus} result.
     * 
     * @param source the file whose syntax should be checked by a syntax checker.
     * @param context the build context of the file. Implementations can decide whether to perform a syntax
     *        check based on the given build context.
     * @param monitor the progress monitor for progress reporting
     * @return the result of the syntax check
     */
    public IStatus perform(IFile source, IBuildContext context, IProgressMonitor monitor);
}
